<!-- 标题组件 -->
<script lang="ts" setup>
import type { CSSProperties } from "vue";

const props = withDefaults(defineProps<{ size?: number; title?: string }>(), {
  size: 28,
});

const titleStyle = computed<CSSProperties>(() => {
  return {
    fontSize: `${props.size}px`,
  };
});
</script>

<template>
  <span v-if="title" :style="titleStyle" class="ml-5">{{ title }}</span>
</template>

<style scoped></style>
